Object.defineProperty(exports, "__esModule", {
  value: true
});
var $2GameEvent = require("GameEvent");
var $2PlatformMgr = require("PlatformMgr");
var def_Tools = /* */function () {
  function _ctor() {
    babel_classCallCheck(this, _ctor);
  }
  return babel_createClass(_ctor, null, [{
    key: "log",
    value: function log() {
      var _console;
      (_console = console).log.apply(_console, arguments);
    }
  }, {
    key: "NumberFix",
    value: function NumberFix(e, t) {
      return Math.floor(e * t) / t;
    }
  }, {
    key: "NumberFixOfRound",
    value: function NumberFixOfRound(e, t) {
      return Math.round(e * t) / t;
    }
  }, {
    key: "GetLocalStorageData",
    value: function GetLocalStorageData(e, t) {
      var n = cc.sys.localStorage.getItem(e);
      null != n && "" !== n && null != n || (n = t);
      return n;
    }
  }, {
    key: "SetLocalStorageData",
    value: function SetLocalStorageData(e, t) {
      cc.sys.localStorage.setItem(e, t);
    }
  }, {
    key: "ApproximatelyEqual",
    value: function ApproximatelyEqual(e, t, n) {
      return Math.abs(e - t) < n;
    }
  }, {
    key: "pointData",
    value: function pointData(e, t, n) {
      console.log("触发打点数据：" + e);
      setTimeout(function () {
        if (n && !cc.sys.localStorage.getItem("data__" + e)) {
          cc.sys.localStorage.setItem("data__" + e, 1);
          $2GameEvent.default.sendEvent(e, babel_defineProperty({}, e, t.toString()));
        } else {
          $2GameEvent.default.sendEvent(e, babel_defineProperty({}, e, t.toString()));
        }
      }, 1e3);
    }
  }, {
    key: "seeVideo",
    value: function seeVideo(e, t, n) {
      var _this92 = this;
      if (1 == this.isvideo) {
        this.isvideo = false;
        if (t) {
          $2PlatformMgr.default.Instance().play_AD(function (t) {
            if (true === t) {
              _this92.isvideo = true;
              console.log("广告播放成功逻辑");
              e();
            } else {
              _this92.isvideo = true;
              n && n();
            }
          }, {
            videoid: 1,
            origin: "seeVideo",
            level: ""
          });
        } else {
          $2PlatformMgr.default.Instance().play_AD(function (t) {
            if (true === t) {
              _this92.isvideo = true;
              console.log("广告播放成功逻辑");
              e();
            } else {
              _this92.isvideo = true;
            }
          }, {
            videoid: 1,
            origin: "seeVideo",
            level: ""
          });
        }
      }
    }
  }]);
}();
exports.default = def_Tools;
def_Tools.isvideo = true;